任务报告推送
注册回调,你将实时接收任务报告。
要注册回调,你只需提供回调信息。
回调包含用于认证的url和appId。url格式如https://{{host}}/xx/xx
。appId格式如"24416c36-d9c7-4d74-a047-d6ca461fxxxx"。此外,http方法应为POST。
当任务报告生成时,你的回调将立即被调用。
示例curl命令:
curl --location 'https://{{host}}/xx/xx' \
--header 'accept: */*' \
--header 'Content-Type: application/json' \
--data '{
"appId": "24416c36-aaaa-4d74-aaaa-d6ca461faaaa",
"payload": {
"serialNumber": "TEST00-0000-000-XXXX",
"modelTypeCode": "Scrubber S1",
"taskReport": {
"id": "684c183c-4ad9-467b-ac7c-55835255AAAA",
"taskId": "233123123-d9c7-4d74-a047-d6ca461faaaa",
"planId": "233123123-d9c7-4d74-a047-d6ca461faaaa",
"taskInstanceId": "893cbadf-3bb1-45be-b7ef-d590d54fAAAA",
"displayName": "ceshi2",
"startTime": 1714124784000,
"endTime": 1714124890000,
"robot": "S2153",
"robotSerialNumber": "TEST00-0000-000-xxxx",
"operator": "admin",
"completionPercentage": 0.156,
"durationSeconds": 106,
"plannedCleaningAreaSquareMeter": 67.425,
"actualCleaningAreaSquareMeter": 10.548,
"efficiencySquareMeterPerHour": 407.965,
"plannedPolishingAreaSquareMeter": null,
"actualPolishingAreaSquareMeter": null,
"waterConsumptionLiter": 0.0,
"startBatteryPercentage": 38.0,
"endBatteryPercentage": 38.0,
"consumablesResidualPercentage": {
"brush": 100.0,
"filter": 100.0,
"suctionBlade": 100.0
},
"cleaningMode": "清扫",
"taskEndStatus": 1,
"subTasks": [
{
"mapId": "370192bd-fe7f-40d0-8d0a-4360415bb8cf",
"mapName": "ceshi2",
"actualCleaningAreaSquareMeter": 10.548,
"taskId": "233123123-d9c7-4d74-a047-d6ca461faaaa"
}
],
"taskReportPngUri": "https://bot.release.gs-robot.com/robot-task/task/report/png/v2/en/684c183c-4ad9-467b-ac7c-55835255aaaa"
}
}
}'
参数描述:
字段名称 | 字段类型 | 字段描述 | 示例 |
---|---|---|---|
appId | String | 用于认证 | "24416c36-d9c7-4d74-a047-d6ca461fxxxx" |
payload | Object | 事件消息内容 | |
payload.serialNumber | String | 机器人序列号 | "TEST00-0000-000-XXXX" |
payload.modelTypeCode | String | 机器人型号代码 | "Scrubber 50H" |
payload.taskReport | Object | 任务报告 | |
payload.taskReport.id | String | 任务ID | "24416c36-d9c7-4d74-a047-d6ca461faaaa" |
payload.taskReport.taskInstanceId | String | 任务实例ID | "32803b4c-7a58-45c5-a1e4-e636e89baaaa" |
payload.taskReport.taskId | String | 静态任务id | "32803b4c-7a58-45c5-a1e4-e636e89baaaa" |
payload.taskReport.planId | String | 调度计划id | "32803b4c-7a58-45c5-a1e4-e636e89baaaa" |
payload.taskReport.displayName | String | 任务的可读名称 | "10楼清洁任务" |
payload.taskReport.startTime | Long | 任务开始时间,时间戳,单位:毫秒 | 1714290913000 |
payload.taskReport.endTime | Long | 任务结束时间,时间戳,单位:毫秒 | 1714290952000 |
payload.taskReport.robot | String | 机器人的可读名称 | "S2153" |
payload.taskReport.robotSerialNumber | String | 机器人序列号 | "GS000-XXXX-XXX-XXXX" |
payload.taskReport.operator | String | 任务操作员 | "Mike" |
payload.taskReport.completionPercentage | Double | 任务完成百分比,范围0-1 | 0.55 |
payload.taskReport.durationSeconds | Integer | 任务持续时间(秒) | 300 |
payload.taskReport.plannedCleaningAreaSquareMeter | Double | 计划清洁面积(平方米) | 200.5 |
payload.taskReport.actualCleaningAreaSquareMeter | Double | 实际清洁面积(平方米) | 100.2 |
payload.taskReport.efficiencySquareMeterPerHour | Double | 清洁效率(平方米/小时) | 300.7 |
payload.taskReport.plannedPolishingAreaSquareMeter | Double | 计划抛光面积(平方米) | 200.5 |
payload.taskReport.actualPolishingAreaSquareMeter | Double | 实际抛光面积(平方米) | 200.5 |
payload.taskReport.waterConsumptionLiter | Double | 任务期间的水消耗量(升) | 5.0 |
payload.taskReport.startBatteryPercentage | Double | 任务开始时的电池电量百分比,范围0-100 | 70.0 |
payload.taskReport.endBatteryPercentage | Double | 任务结束时的电池电量百分比,范围0-100 | 40.0 |
consumablesResidualPercentage | Object | 消耗品剩余百分比 | |
consumablesResidualPercentage.brush | Double | 刷子的剩余寿命百分比 | 50.0 |
coumablesResidualPercentage.filter | Double | 过滤器的剩余寿命百分比 | 50.0 |
coumablesResidualPercentage.suctionBlade | Double | 吸尘器刮刀的剩余寿命百分比 | 50.0 |
cleaningMode | String | 清洁模式 | "扫地" |
taskEndStatus | Integer | 任务结束状态。-1:未知,0:正常结束,1:手动结束,2:异常结束,3:启动失败 | 0 |
subTasks | Array | 子任务列表 | |
subTasks[0].mapId | String | 地图ID | "370192bd-fe7f-40d0-8d0a-4360415baaaa" |
subTasks[0].mapName | String | 地图名称 | "测试地图" |
subTasks[0].actualCleaningAreaSquareMeter | Double | 实际清洁面积(平方米) | 10.0 |
subTasks[0].taskId | Double | 子任务id | "32803b4c-7a58-45c5-a1e4-e636e89baaaa" |
taskReportPngUri | String | 任务报告png URI | "https://bot.gs-robot.com/robot-task/task/report/png/v2/en/47e3628b-a2b9-4124-bbbc-45e0d4bfaaaa" |